 /**
 * Description: 物资借出记录
 * @author:Hunter
 * @since:1.0.0
 *
 * Modification History:
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2018-04-08   Hunter       1.0.0     Initial
 */
package com.metro.paperless.report.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.metro.core.dao.IMapper;
import com.metro.core.service.BaseServiceSupport;
import com.metro.core.service.ServiceException;
import com.metro.core.vo.JsonResult;
import com.metro.core.vo.ResultCode;
import com.metro.core.vo.inf.IResult;
import com.metro.paperless.app.beans.vo.AppLendDetail;
import com.metro.paperless.app.beans.vo.AppLendDetailForm;
import com.metro.paperless.app.beans.vo.AppMaterialsLend;
import com.metro.paperless.app.mapper.IAppLendDetailMapper;
import com.metro.paperless.app.mapper.IAppMaterialsLendMapper;
import com.metro.paperless.app.service.inf.IAppLendDetailService;
import com.metro.paperless.app.service.inf.IAppMaterialsLendService;
import com.metro.paperless.biz.beans.vo.BizMaterialsManage;
import com.metro.paperless.biz.mapper.IBizMaterialsManageMapper;
import com.metro.paperless.report.beans.vo.ReportLend;
import com.metro.paperless.report.mapper.IReportLendMapper;
import com.metro.paperless.report.service.inf.IReportLendService;

 /**
 * 物资借出记录<br>
 *
 * @author:Hunter
 * @since:1.0.0
 * @version [1.0.0, 2018-04-08]
 */
@Service("reportLendService")
public class ReportLendService extends BaseServiceSupport<ReportLend> implements IReportLendService{
    //物资借出记录Mapper
    @Autowired
    private IReportLendMapper reportLendMapper;

    @SuppressWarnings({ "unchecked", "rawtypes" })
	@Override
    public IMapper getMapper() {
        return reportLendMapper;
    }

    @Override
    public IResult save(ReportLend entity) {
        try {
        	reportLendMapper.save(entity);
            return ResultCode.SUCCESS;
        } catch (Exception e) {
            log.error("新增物资借出记录失败", e);
            throw new ServiceException(ResultCode.ERROR);
        }
    }

    @Override
    public IResult update(ReportLend entity) {
        try {
        	reportLendMapper.update(entity);
            return ResultCode.SUCCESS;
        } catch (Exception e) {
            log.error("修改物资借出记录失败", e);
            throw new ServiceException(ResultCode.ERROR);
        }
    }

    @Override
    public IResult delete(Long id) {
        try {
        	reportLendMapper.delete(id);
            return ResultCode.SUCCESS;
        } catch (Exception e) {
            log.error("删除失败", e);
            throw new ServiceException(ResultCode.ERROR);
        }
    }

    @Override
    public IResult deleteByIds(String ids) {
        try {
        	reportLendMapper.deleteByIds(ids);
            return ResultCode.SUCCESS;
        } catch (Exception e) {
            log.error("删除失败", e);
            throw new ServiceException(ResultCode.ERROR);
        }
    }
}